package graphicsExtended.panelDrawer;

import graphicsExtended.templates.interfaces.Drawable;
import java.awt.Graphics2D;
import java.util.ArrayList;
import javax.swing.JPanel;

/**
 *
 * @author Shimu
 * @date 12-Jul-2012
 */
public class SimplePanelDrawer implements PanelDrawer{

    private ArrayList<Drawable> drawables;
    
    public SimplePanelDrawer(ArrayList<Drawable> drawables) {
        this.drawables = drawables;
    }
    
    public void addDrawable(Drawable drawable) {
        drawables.add(drawable);
    }
    
    @Override
    public void drawAll(Graphics2D g) {
        for (Drawable object : drawables) {
            object.draw(g);
        }
    }

    public void init(JPanel panel) {
        // Does nothing on startup
    }
    
}
